Rahul Mahajan
   E-Mail: mahajan_rahul@hotmail.com

Multiple User Accounts and User Login

Multiple User Accounts with User Authentication with the help of Database connection.

Files included as follows - 

File Type

-

File Name Details
Registration File - registration.asp The registration page for new user.
Login File - login.asp The login page of website.
Forgot Password File - forget.asp The password retrieving page of website.
Authentication File - logincheck.asp File used for User/Login Authentication.
Protected Area File - protected.asp The protected file/area of website.
Login Check File - validate.asp The file use at the time of login.
Unauthorized Area File - unauthorized.asp File will be shown on unauthorized login.
Logout File - logout.asp The logout page of website.
Contact Form - contactus.html Feedback/Contact Form of website.
For Administrator
View User Information File - edituser.asp Admin can view user's account information.
Delete User File - deleteuser.asp Admin can delete user's account information.

Database File (i.e. users.mdb) is password protected named -  password

Other Added VBScripts & Asp Files - All these files are in a folder named Example.
Database (.mdb) File
Global.asa File

Code Briefing:

  • Now let me tell you how it works. Firstly, when the user want to visit the PROTECTED AREA of your site, he/she have to register his/her name before login - registration.asp
  • After completing the Registration process, new user can login - login.asp
  • User enters the Username and Password - if the Username and Password is correct, then the protected page will be open - protected.asp
  • If the Username or Password are incorrect - an error message will be displayed and user will be redirected to login page again.
  • To logout the protected area of the file simply click - logout.asp
  • After logout, if the the user/member has to login again then he/she have to login again.

Simple!

About Authentication File (logincheck.asp):

 

Please  note that this file is very important if you have links in PROTECTED AREA of your website and you want them not to be open without login, then this code is for you.

Example:

Login Page --> After entering correct Username & Password opens --> Protected Page

Protected Page

|

Link1 - Link2 - Link3 - Link4 - Link5

Suppose the user visits the PROTECTED AREA of the website on Day1 and found that there are some Links which are written in protected page (i.e. protected.asp, in this case) and the user visits one of the given link. If the user notes the URL of that particular page then the user can easily visit that page without login. To prevent this, Authentication File is used. Therefore user has to login each time user visit the site.

There are two methods to perform - 

1. By including Authentication File on the top of every page linked to PROTECTED AREA before <html> tag.

<!--#include file="logincheck.asp"-->

2. By writing the content of the logincheck.asp on the top of every page PROTECTED AREA before <html> tag.

 

Please copy all files on IIS5.0 or IIS6.0 and check it yourself.

 

Click Here To See The DEMO

Important: If you want to test the code on free server, then you must upload the files on a free server which supports ASP and MS-Access.

PLEASE RATE THE SCRIPT ON PLANETSOURCECODE.COM

 

If You still face any problem then please mail me on above E-Mail address.

Happy Programming!
This page was Designed and Developed by Rahul Mahajan on Thursday, 5th May, 2005.